3 char m
[32][32], d
, x
= 'X';
6 for (scanf("%d", &c
); c
-- && scanf("%d %d\n", &j
, &i
) == 2 && printf("Bitmap #%d\n", t
++); printf("\n")){
7 memset(m
, '.', sizeof m
);
8 while (scanf("%c", &c
) && c
!= '.'){
9 if (c
== 'E') m
[i
-1][j
++] = x
;
10 else if (c
== 'W') m
[i
][(j
--)-1] = x
;
11 else if (c
== 'S') m
[(i
--)-1][j
-1] = x
;
12 else if (c
== 'N') m
[i
++][j
] = x
;
14 for (i
=31; i
>=0; --i
, printf("\n"))
15 for (j
=0; j
<32; printf("%c", m
[i
][j
++]));